<template>
  <div class="main">
    <MeteData :field="field"></MeteData>
    <div class="info-group">
      <div class="group-title">
        服务器名称 serverName
      </div>
      <div class="group-data">
        {{ field.serverName }}
      </div>
    </div>

    <div class="info-group">
      <div class="group-title">
        类型 model
      </div>
      <div class="group-data">
        {{ model }}
      </div>
    </div>

    <div class="info-group">
      <div class="group-title">
        版本 version
      </div>
      <div class="group-data">
        {{ field.version }}
      </div>
    </div>

    <div class="info-group">
      <div class="group-title">
        操作类型 operateType
      </div>
      <div class="group-data">
        {{ operateType }}
      </div>
    </div>

    <div class="info-group">
      <div class="group-title">
        账号 account
      </div>
      <div class="group-data">
        {{ field.account }}
      </div>
    </div>

    <div class="info-group">
      <div class="group-title">
        密码 password
      </div>
      <div class="group-data">
        {{ field.password }}
      </div>
    </div>

    <div class="info-group">
      <div class="group-title">
        发件人 sender
      </div>
      <div class="group-data">
        {{ field.sender }}
      </div>
    </div>

    <div class="info-group">
      <div class="group-title">
        收件人 receiver
      </div>
      <div class="group-data">
        {{ field.receiver }}
      </div>
    </div>

    <div class="info-group">
      <div class="group-title">
        邮件标题 title
      </div>
      <div class="group-data">
        {{ field.title }}
      </div>
    </div>

    <div class="info-group">
      <div class="group-title">
        邮件内容 content
      </div>
      <div class="group-data">
        {{ field.content }}
      </div>
    </div>

    <div class="info-group">
      <div class="group-title">
        附件 attachment
      </div>
      <div class="group-data">
        {{ field.attachment }}
      </div>
    </div>

    <div class="info-group">
      <div class="group-title">
        执行结果 result
      </div>
      <div class="group-data">
        {{ result }}
      </div>
    </div>
  </div>
</template>

<script>
import MeteData from './metaData.vue';

export default {
  name: 'yunche_email',
  props: ['field'],
  components: { MeteData },
  data() {
    return {};
  },

  computed: {
    model() {
      switch (this.field.model) {
        case 0:
          return 'POP';

        case 1:
          return 'IMAP';

        case 2:
          return 'SMTP';

        default:
          return 'NULL';
      }
    },

    operateType() {
      switch (this.field.operateType) {
        case 0:
          return '登录';

        case 1:
          return '邮件';

        default:
          return 'NULL';
      }
    },

    result() {
      switch (this.field.result) {
        case 0:
          return '成功';

        case 1:
          return '失败';

        default:
          'NULL';
      }
    },
  },
};
</script>

<style scoped>
@import '../basicInfo.css';
</style>
